// renderToFile.cpp : implementation file
// Author:	Dani Brunstein, 3/11/2001
//			Computer Graphics
// Send bugs to: danikoz@cs.technion.ac.il
//

#include "stdafx.h"
#include "CGWork.h"
#include "renderToFile.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// renderToFile dialog


renderToFile::renderToFile(CWnd* pParent /*=NULL*/)
	: CDialog(renderToFile::IDD, pParent)
{
	//{{AFX_DATA_INIT(renderToFile)
	m_nHeight = 0;
	m_nWidth = 0;
	m_bUseWinDim = FALSE;
	//}}AFX_DATA_INIT
}


void renderToFile::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(renderToFile)
	DDX_Control(pDX, IDC_SAVE_WIDTH, m_controlWidth);
	DDX_Control(pDX, IDC_SAVE_HEIGHT, m_controlHeight);
	DDX_Text(pDX, IDC_SAVE_HEIGHT, m_nHeight);
	DDV_MinMaxInt(pDX, m_nHeight, 1, 768);
	DDX_Text(pDX, IDC_SAVE_WIDTH, m_nWidth);
	DDV_MinMaxInt(pDX, m_nWidth, 1, 1024);
	DDX_Check(pDX, IDC_USE_WIN_DIM, m_bUseWinDim);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(renderToFile, CDialog)
	//{{AFX_MSG_MAP(renderToFile)
	ON_BN_CLICKED(IDC_USE_WIN_DIM, OnUseWinDim)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// renderToFile message handlers
void renderToFile::OnUseWinDim() 
{
	if (m_bUseWinDim) {		// use original window dimentions
		m_bUseWinDim = false;
		m_controlHeight.EnableWindow(TRUE);
		m_controlWidth.EnableWindow(TRUE);
	} else {
		m_bUseWinDim = true;
		m_controlHeight.EnableWindow(FALSE);
		m_controlWidth.EnableWindow(FALSE);
	}
}
